package com.yonyou.sto.modules.ums.util;

import com.yonyou.sto.modules.ims.model.ImsInvoice;
import com.yonyou.sto.modules.ims.model.ImsInvoiceItem;
import com.yonyou.sto.modules.ims.service.ImsInvoiceService;
import com.yonyou.sto.modules.ums.service.ConfigNameServic;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@Component
public class InvoiceConfigNameUtil {

    @Resource
    private ImsInvoiceService imsInvoiceService;

    @Resource
    private ConfigNameServic configNameServic;

    public List<ImsInvoiceItem> getInvoiceItemConfigName(List<ImsInvoiceItem> items){
        List<ImsInvoiceItem> collect1 = items.stream().map(m -> {
            m.setCustmatname(configNameServic.getCustCofigStringName(m));
            return m;
        }).collect(Collectors.toList());
        return collect1;
    }
}
